#ifndef _HELLO_H_
#define _HELLO_H_
#include <linux/ioctl.h>
//#include <linux/ioctl.h>
#ifndef HELLO_MAJOR
#define HELLO_MAJOR 	0
#endif

#ifndef DEVICE_NR
#define DEVICE_NR		4
#endif

#ifndef QUANTUM
#define QUANTUM		4000
#endif

#ifndef QSET
#define QSET                 	1000
#endif

#ifndef 
extern int hello_major;
extern int hello_minor;
extern int hello_nr;
extern int quatum;
extern int qset;

struct hello_qset{
	void **data;
	struct hello_qset *next;
};

struct hello_dev {
   wait_queue_head_t r_wait,w_wait;
	struct hello_qset *data;
	struct semaphore sem;
	unsigned int access_key; 
	int quantum_size;
	int qset_size;
   unsigned int  cur_len;
	unsigned long size;
	struct cdev	dev;
};

ssize_t hello_read(struct file *filp,char __user *buf,size_t count,loff_t *f_pos);
ssize_t hello_write(struct file *filp,const char __user *buf,size_t count,loff_t *f_pos);
int hello_open(struct inode* node,struct file *filp);
int hello_release(struct inode *node,struct file *filp);

#define HELLO_IOC_MAGIC  'k'

#define HELLO_IOCRESET     _IO(HELLO_IOC_MAGIC,0)
#define HELLO_IOCSQUANTUM  _IOW(HELLO_IOC_MAGIC,1,int)
#define HELLO_IOCSQSET     _IOW(HELLO_IOC_MAGIC,2,int)
#define HELLO_IOCTQUANTUM  _IO(HELLO_IOC_MAGIC,3)
#define HELLO_IOCTQSET     _IO(HELLO_IOC_MAGIC,4)
#define HELLO_IOCGQUANTUM  _IOR(HELLO_IOC_MAGIC,5,int)
#define HELLO_IOCGQSET     _IOR(HELLO_IOC_MAGIC,6,int)
#define HELLO_IOCQQUANTUM  _IO(HELLO_IOC_MAGIC,7)
#define HELLO_IOCQQSET     _IO(HELLO_IOC_MAGIC,8)
#define HELLO_IOCXQUANTUM  _IOWR(HELLO_IOC_MAGIC,9,int)
#define HELLO_IOCXQSET     _IOWR(HELLO_IOC_MAGIC,10,int)
#define HELLO_IOCHQUANTUM  _IO(HELLO_IOC_MAGIC,11)
#define HELLO_IOCHQSET     _IO(HELLO_IOC_MAGIC,12)

#define HELLO_IOC_MAXNR  12



#endif
